import Vue from "vue";
import EleForm from "vue-ele-form";
import EleFormCodemirror from "vue-ele-form-codemirror";
// 以下仅为示例, 具体根据需要, 在局部或者全局引入相应的资源
// 属性和引用资源参考: https://github.com/surmon-china/vue-codemirror
// Language js
import "codemirror/mode/javascript/javascript.js";
// Theme css
import "codemirror/theme/base16-dark.css";

// 注册 codemirror 组件
Vue.component(`codemirror`, EleFormCodemirror);

// 注册 vue-ele-form
Vue.use(EleForm, {
  // 可以为编辑器配置全局属性, 每个实例都共享这个属性
  codemirror: {
    options: {
      theme: `base16-dark`,
      tabSize: 4,
      mode: `text/javascript`,
      lineNumbers: true,
      line: true
    }
    // Events: ['scroll', ...]
  }
});
